//
//  SelfLikeViewController.swift
//  DianShangWen
//
//  Created by 周文轩 on 15/4/27.
//  Copyright (c) 2015年 &#21608;&#25991;&#36713;. All rights reserved.
//

import UIKit

class SelfLikeViewController: UIViewController, UIScrollViewDelegate {
    
    @IBOutlet weak var curriculumButton: UIButton!
    @IBOutlet weak var curriculumView: UIView!
    @IBOutlet weak var responseButton: UIButton!
    @IBOutlet weak var responseView: UIView!
    @IBOutlet weak var mealButton: UIButton!
    @IBOutlet weak var mealView: UIView!
    @IBOutlet weak var selfLikeScrollView: UIScrollView!
    
    @IBOutlet weak var selfLikeScrollViewWith: NSLayoutConstraint!

    override func viewDidLoad() {
        super.viewDidLoad()
        selfLikeScrollViewWith.constant = UIScreen.mainScreen().bounds.size.width*3

        creatSelfLikeScrollView()
        
        // Do any additional setup after loading the view.
    }
    
    func creatSelfLikeScrollView() {
        selfLikeScrollView.delegate = self
    }
    
    @IBAction func curriculumButtonTouch() {
        curriculumButton.setTitleColor(ResourceProvider.sharedInstance.redColoer, forState: UIControlState.Normal)
        curriculumView.backgroundColor = ResourceProvider.sharedInstance.redColoer
        responseButton.setTitleColor(UIColor.blackColor(), forState: UIControlState.Normal)
        responseView.backgroundColor = UIColor.whiteColor()
        mealButton.setTitleColor(UIColor.blackColor(), forState: UIControlState.Normal)
        mealView.backgroundColor = UIColor.whiteColor()
        
        selfLikeScrollView.contentOffset.x = 0
    }
    
    @IBAction func responseButtonTouch() {
        responseButton.setTitleColor(ResourceProvider.sharedInstance.redColoer, forState: UIControlState.Normal)
        responseView.backgroundColor = ResourceProvider.sharedInstance.redColoer
        curriculumButton.setTitleColor(UIColor.blackColor(), forState: UIControlState.Normal)
        curriculumView.backgroundColor = UIColor.whiteColor()
        mealButton.setTitleColor(UIColor.blackColor(), forState: UIControlState.Normal)
        mealView.backgroundColor = UIColor.whiteColor()
        
        selfLikeScrollView.contentOffset.x = self.view.frame.size.width
    }
    
    @IBAction func mealButtonTouch() {
        mealButton.setTitleColor(ResourceProvider.sharedInstance.redColoer, forState: UIControlState.Normal)
        mealView.backgroundColor = ResourceProvider.sharedInstance.redColoer
        responseButton.setTitleColor(UIColor.blackColor(), forState: UIControlState.Normal)
        responseView.backgroundColor = UIColor.whiteColor()
        curriculumButton.setTitleColor(UIColor.blackColor(), forState: UIControlState.Normal)
        curriculumView.backgroundColor = UIColor.whiteColor()
        
        selfLikeScrollView.contentOffset.x = self.view.frame.size.width*2
    }

    override func didReceiveMemoryWarning() {
        super.didReceiveMemoryWarning()
        // Dispose of any resources that can be recreated.
    }
    

    /*
    // MARK: - Navigation

    // In a storyboard-based application, you will often want to do a little preparation before navigation
    override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) {
        // Get the new view controller using segue.destinationViewController.
        // Pass the selected object to the new view controller.
    }
    */

}
